package com.otaliastudios.cameraview.livedata

import androidx.annotation.MainThread
import androidx.lifecycle.MutableLiveData
import com.otaliastudios.cameraview.size.Size

/**
 * 分辨率设置的尺寸
 */
class SizeLiveData(val isRecord: Size = Size(1920, 1080)) : MutableLiveData<Size>(isRecord) {

    companion object {
        private lateinit var sInstance: SizeLiveData

        @MainThread
        fun get(): SizeLiveData {
            sInstance = if (Companion::sInstance.isInitialized) sInstance else SizeLiveData()
            return sInstance
        }
    }

}